package com.xiexie.seckill.service;

import com.xiexie.seckill.pojo.Order;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiexie.seckill.pojo.User;
import com.xiexie.seckill.vo.GoodsVo;

/**
 *  服务类
 *
 * @author xiexie
 * @date 2021-07-31
 */
public interface IOrderService extends IService<Order> {

    /**
     * 秒杀
     *
     * @param user
     * @param goodsVo
     * @return
     */
    Order seckill(User user, GoodsVo goodsVo);

    /**
     * 获取真实秒杀地址
     *
     * @param user
     * @param goodsId
     * @return
     */
    String createPath(User user, Long goodsId);

    /**
     * 判断秒杀地址是否存在
     *
     * @param user
     * @param goodsId
     * @param path
     * @return
     */
    boolean checkPath(User user, Long goodsId, String path);

    /**
     * 验证 captcha
     *
     * @param user
     * @param goodsId
     * @param captcha
     */
    boolean checkCaptcha(User user, Long goodsId, String captcha);
}
